from django.views import View
from django.shortcuts import render
from courses.models import Course


class CourseList(View):
    """课程列表"""
    def get(self, request):
        return render(request, 'course-list.html')


class CourseDetail(View):
    """课程详页"""
    def get(self, request):
        user_courses = Course.objects.all()
        return render(request, 'course-detail.html', {'user_courses': user_courses})


